﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="census_score.aspx.cs" Inherits="census_score" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>统计成绩信息</title>
    <style type="text/css">
        .auto-style1 {
            font-size: large;
        }
        .auto-style2 {
            text-align: center;
        }
        .auto-style3 {
            font-size: large;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div class="auto-style2">
    
        <strong><span class="auto-style1">课程 </span>
        <asp:Label ID="Label1" runat="server" CssClass="auto-style1" Text="Label"></asp:Label>
        <span class="auto-style1">&nbsp;的统计：<br />
        <br />
        </span></strong><span class="auto-style3">及格率：<asp:Label ID="Label2" runat="server" CssClass="auto-style1" Text="Label"></asp:Label>
        %<br />
        <br />
        分数段统计表：</span><span class="auto-style1"><strong><br />
        <asp:Chart ID="Chart1" runat="server" DataSourceID="SqlDataSource1">
            <Series>
                <asp:Series Name="Series1" XValueMember="分数段" YValueMembers="人数">
                </asp:Series>
            </Series>
            <ChartAreas>
                <asp:ChartArea Name="ChartArea1">
                </asp:ChartArea>
            </ChartAreas>
        </asp:Chart>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:XSXKConnectionString4 %>" SelectCommand="select 分数段, 人数=count(*)from
(
  select score, 分数段=case
    when score between 0  and 59  then'0～59'
    when score between 60 and 84 then'60～84'
    when score between 85 and 100 then'85～100'
    end
  from result
 where result.Cno=@Cno
) t
group by 分数段">
            <SelectParameters>
                <asp:QueryStringParameter Name="Cno" QueryStringField="Cno" />
            </SelectParameters>
        </asp:SqlDataSource>
        <br />
        <br />
        </strong></span>
    
    </div>
    </form>
</body>
</html>
